﻿using NineSeas.Models;
using NineSeas.ViewModels;
using Orchard;
using System.Collections.Generic;
using Orchard.ContentManagement;
using NineSeas.Extensions;
namespace NineSeas.Services
{
    public interface IBookService: IDependency
    {
        IList<BookSummaryViewModel> Search(BookSearchViewModel search, PaginationInfo paging);
        IList<BookSummaryViewModel> Search(BookSearchViewModel search, PaginationInfo paging, VersionOptions options);
        IList<BookSummaryViewModel> GetBooksByAuthor(int authorId, PaginationInfo paging);
        BookPart GetByName(string name);
        BookValidationResult ValidateBook(BookViewModel bookViewModel);

        MessageDefinition SaveTags(BookPart book, IEnumerable<string> tagNames);
        void SaveCategories(BookPart book, IEnumerable<int> categoryIds);
        MessageDefinition ProcessPublication(BookPart book, PublishingViewModel publishingDetails);

        void Delete(int id);
    }
    public enum BookValidationResult
    {
        Success = 0,
        NameOnUrlExists = 1
    }
}
